//
//  AddGroupChaHeadertCell.m
//  PigMarket
//
//  Created by mac on 2019/6/17.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "AddGroupChatHeaderCell.h"

@interface AddGroupChatHeaderCell ()
/**
 img
 */
@property (nonatomic , strong) UIImageView *headerImg;

@end
@implementation AddGroupChatHeaderCell
#pragma mark - init method
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
        [self initLayout];
    }
    return self;
}

- (void)initView {
    // 添加子控件
    [self.contentView addSubview:self.headerImg];
}

- (void)initLayout {
    // 布局子控件
    [self.headerImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView.mas_centerX);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(34, 34));
    }];
}
- (void)configCellWithModel:(Friends *)model{
    self.headerImg.image = model.headImage;
//    [self.headerImg sd_setImageWithURL:[NSURL URLWithString:model.headImg] placeholderImage:[UIImage imageNamed:@"placeholder_header"]];
}
#pragma mark - getter and setter
- (UIImageView *)headerImg {
    if (!_headerImg) {
        _headerImg = [[UIImageView alloc] init];
        _headerImg.layer.cornerRadius = 17;
        _headerImg.layer.masksToBounds = YES;
    }
    return _headerImg;
}
@end
